<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>lesson 7</title>
  <script src="https://unpkg.com/vue@next"></script>
  <style>

    .tl-font24-fff{
      color: #fff;
    }
    .transition{
      transition: 3s background-color ease;
    }
    .blue{
      background: blue;
    }
    .green{
      background: green;
    }
  </style>
</head>
<body>
  <div id="root"></div>
</body>
<script>
  const app = Vue.createApp({
    data() {
      return {
        message: "hello world",
        animate: {
          transition: true,
          blue: true,
          green: false,
        }
      }
    },
    methods: {
      handleClick(){
        this.animate.blue = !this.animate.blue;
        this.animate.green = !this.animate.green;
      }
    },

    template: `
      <div>
      <div :class="animate" class="tl-font24-fff">
        Hello Word
      </div>
      <div>
        <button @click="handleClick">切换</button>
      </div>
      </div>
    `
  });
  const vm = app.mount('#root');
</script>
</html>